 package tools;

















 public class BitTools
 {
   public static int getShort(byte[] array, int index) {
/*  22 */     int ret = array[index];
/*  23 */     ret &= 0xFF;
/*  24 */     ret |= array[index + 1] << 8 & 0xFF00;
/*  25 */     return ret;
   }












   public static String getString(byte[] array, int index, int length) {
/*  40 */     char[] cret = new char[length];
/*  41 */     for (int x = 0; x < length; x++) {
/*  42 */       cret[x] = (char)array[x + index];
     }
/*  44 */     return String.valueOf(cret);
   }










   public static String getMapleString(byte[] array, int index) {
/*  57 */     int length = array[index] & 0xFF | array[index + 1] << 8 & 0xFF00;
/*  58 */     return getString(array, index + 2, length);
   }














   public static byte rollLeft(byte in, int count) {
/*  75 */     int tmp = in & 0xFF;

/*  77 */     tmp <<= count % 8;
/*  78 */     return (byte)(tmp & 0xFF | tmp >> 8);
   }

















   public static byte rollRight(byte in, int count) {
/*  98 */     int tmp = in & 0xFF;
/*  99 */     tmp = tmp << 8 >>> count % 8;

/* 101 */     return (byte)(tmp & 0xFF | tmp >>> 8);
   }












   public static byte[] multiplyBytes(byte[] in, int count, int mul) {
/* 116 */     byte[] ret = new byte[count * mul];
/* 117 */     for (int x = 0; x < count * mul; x++) {
/* 118 */       ret[x] = in[x % count];
     }
/* 120 */     return ret;
   }







   public static int doubleToShortBits(double d) {
/* 130 */     long l = Double.doubleToLongBits(d);
/* 131 */     return (int)(l >> 48L);
   }
 }


/* Location:              C:\PGX\Server.jar!\tools\BitTools.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */